package cn.itcast.nems.studentrecord.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDate;
import java.time.LocalDateTime;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class SuspendStudent {

    private String journalTransferId;
    private String journalTransferLineId;

    private String createdBy;
    private String createdByName;
    private String createdByAndName;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    private LocalDateTime createdDatetime;

    private Integer targetClazzId;
    private String targetClazzName;
    private Integer targetClazzPrice;
    private String targetClazzSubjectId;
    private String targetClazzSubjectName;
    private String targetClazzCampusId;
    private String targetClazzCampusName;
    private String targetClazzModelId;
    private String targetClazzModelName;
    private LocalDate targetClazzInDate;

    private String originStudentRecordId;
    private Integer studentId;
    private String studentNumber;
    private String studentName;
    private Integer originClazzId;
    private String originClazzName;
    private LocalDate originClazzInDate;
    private LocalDate originClazzOutDate;
    private String reasonCode;
    private String reasonDescription;
    private Integer originClazzSettlementAmount;
    private String originClazzSettlementAmountFormatted;
    private Integer originClazzSettlementDays;
    private String remark;

    private Boolean originClazzUpgradeable;

    private String studentRecordId;

    // 来自原来的学籍
    private Integer amountDue;
    private String amountDueFormatted;
    private Integer paidAmount;
    private String paidAmountFormatted;
    private Integer transferAmount;
    private String transferAmountFormatted;
    private Integer pendingAmount;
    private String pendingAmountFormatted;

    // 其他
    private String targetStudentJournalTransferId;
    private String targetStudentJournalTransferLineId;

    //
    private String originClazzTypeId;
    private String originClazzTypeName;
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @JsonSerialize(using = LocalDateSerializer.class)
    @JsonDeserialize(using = LocalDateDeserializer.class)
    private LocalDate originClazzGraduationDate;
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @JsonSerialize(using = LocalDateSerializer.class)
    @JsonDeserialize(using = LocalDateDeserializer.class)
    private LocalDate originClazzPredictionGraduationDate;


    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @JsonSerialize(using = LocalDateSerializer.class)
    @JsonDeserialize(using = LocalDateDeserializer.class)
    private LocalDate targetClazzGraduationDate;
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @JsonSerialize(using = LocalDateSerializer.class)
    @JsonDeserialize(using = LocalDateDeserializer.class)
    private LocalDate targetClazzPredictionGraduationDate;


    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @JsonSerialize(using = LocalDateSerializer.class)
    @JsonDeserialize(using = LocalDateDeserializer.class)
    private LocalDate targetClazzStartDate;
}
